Skip to main content

DigiLocker Webhook

The following document highlights the details of the DigiLocker Webhook.

Overview

The DigiLocker webhook notifies your application when a user completes or cancels the DigiLocker consent flow. It triggers automatically once the user finishes the consent process. To receive webhook notifications, simply register your webhook URL with HyperVerge.

Webhook Events

The webhook delivers notifications for the following user actions:

  • User grants consent: The user completes the DigiLocker journey and grants access to their documents.
  • User denies or cancels: The user explicitly cancels the journey or denies access to documents.

IP Whitelisting

HyperVerge sends webhooks as HTTP POST requests to your registered URL. For those requests to reach your endpoint, you must permit inbound traffic from HyperVerge's source IPs (in your firewall, load balancer, or security group). The following are the source IPs:

65.0.82.147
3.7.90.248
3.6.33.64

Configuration URL

Register the URL where you want to receive notifications using the following API:

https://api.hyperverge.co/api/digilocker/webHook
URL requirement

The URL you register must be a publicly accessible HTTPS endpoint so that HyperVerge can deliver webhooks to it.

Method(s)

  • POST : Store webhook configuration (register your webhook URL)
  • GET : Retrieve current webhook configuration

Authentication

You need a unique pair of application ID (appId) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

Headers

HeaderMandatory / OptionalDescriptionInput Format
appIdMandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
appKeyMandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
Content-TypeMandatory (POST Method only)Defines the media type for the request payload. Required when storing webhook configuration (POST).application/json

Inputs

The following table provides the details of the parameters required for the POST request (store configuration):

ParameterMandatory or OptionalDescription
urlMandatoryThe HTTPS URL that will receive webhook events. Must be publicly accessible. Register this URL before initiating any DigiLocker journeys.

Request

The following code snippets demonstrate the Webhook configuration requests.

curl -X POST 'https://api.hyperverge.co/api/digilocker/webHook' \
-H 'appId: <Enter_the_HyperVerge_appId>' \
-H 'appKey: <Enter_the_HyperVerge_appKey>' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://your-webhook-url.com/endpoint"
}'

Responses

The following code snippets are the HTTP responses from the Configuration API. For the JSON that HyperVerge sends to your URL when an event occurs, see Webhook Payload.

Returned when you successfully store your webhook URL.

{
"status": "success",
"statusCode": "200",
"result": {
"message": "Config added successfully"
}
}

Webhook Payload

When a DigiLocker consent event occurs, the Digilocker webhook sends one of the following four payloads (JSON) to the URL you registered.

Sent when the user successfully completes the DigiLocker journey and grants consent.

{
"refId": "unique-reference-id-from-client",
"event": {
"name": "digilocker.user.consent.granted",
"code": "user_granted_consent"
},
"timeStamp": "2024-01-15T10:30:45.123Z"
}

Payload Details

The following table provides the details of the parameters in the Webhook payload:

ParameterTypeDescription
refIdstringThe reference ID that uniquely identifies the user session, matching the refId you provide in /digilocker/start API call. This implements idempotency when handling duplicate deliveries.
eventobjectThe object contains event details (name and code)
event.namestringThe name of the event. Possible values:
event.codestringThe specific code for the event. Possible values:
  • user_granted_consent
  • user_cancelled
  • user_denied_consent
  • user_cancelled_or_denied_consent
  • See Event names and codes for more details
timeStampstring (ISO 8601)Timestamp when the event occurred

Event names and codes

The following table lists all possible combinations of event.name and event.code and when each is triggered:

event.nameevent.codeTrigger
digilocker.user.consent.granteduser_granted_consentUser completes the DigiLocker journey and grants consent
digilocker.user.denieduser_cancelledUser explicitly cancels the DigiLocker consent process
digilocker.user.denieduser_denied_consentUser explicitly denies access to documents during the consent flow
digilocker.user.denieduser_cancelled_or_denied_consentDefault denied state when the consent process ends without success for any other reason

Support

For additional details on the DigiLocker webhook, please contact our support team at support@hyperverge.co.

Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: